const classNames = require('classnames')
const _ = require('../utils')

_.create('label', {
  options: {
    multipleSlots: true,
  },

  data: {},

  properties: {
    floating: Boolean,
    disabled: Boolean,
    noBordered: Boolean,
    error: Boolean,
    active: Boolean,
    raised: Boolean,
    clickable: Boolean,
    text: { type: String, value: '' },
    helperText: {
      type: String,
      value: '',
    },
  },

  computed: {
    classes(data) {
      const { classPrefix, floating, disabled, noBordered, active, raised, error } = data
      const classes = classNames(classPrefix, {
        [`${classPrefix}-no-bordered`]: noBordered,
        [`${classPrefix}-floating`]: floating,
        [`${classPrefix}-disabled`]: disabled,
        [`${classPrefix}-active`]: active,
        [`${classPrefix}-raised`]: raised,
        [`${classPrefix}-error`]: error,
      })

      return classes
    },
  },
})
